package org.tiddlywiki;

import java.io.File;
import java.io.IOException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

import org.jsoup.select.Elements;
//import java.util.ArrayList;
//import java.util.Iterator;
//import java.util.List;

public class TWEditor {

	public static void main(String[] args) throws IOException {
		File input=new File("C:\\playground2\\wikime.html");
		Document doc=Jsoup.parse(input,"UTF-8","http://example.com");
		Elements divs=doc.select("div[title=echomob]");
		Element tid=divs.first();
		Element text=tid.getElementsByTag("pre").first();
		System.out.println("Size="+tid.getElementsByTag("pre").size());
		System.out.println("Data="+text.text());
		String[] lines = text.text().split("\n");
		for(String line : lines) {
			System.out.println("Line : "+line);			
		}
//		for(Element tiddler : divs) {
//			System.out.println(tiddler.attr("title"));
//		}
	}

}
